
using System.Web;
using System.Data.Common;
using System;
using System.IO;

namespace com.byt.webcore.config
{

    public abstract class IConfig
    {

        public IConfig(HttpRequest request)
        {
        }

        public string getServerPath(ServletBase.Parameters p)
        {
            return this.getServerPath(p.req);
        }

        abstract public string getServerPath(HttpRequest request);

        abstract public string getServerShared(ServletBase.Parameters p);

        abstract public DbConnection getConnection(ServletBase.Parameters p, string nombre);

        abstract public string getPath(ServletBase.Parameters p, string pathName);

        abstract public string getEntry(ServletBase.Parameters p, string entryName);

        public string getHomePath()
        {

            string s = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);

            if (string.IsNullOrEmpty(s))
            {
                s = @"c:\";
            }
            if (!s.EndsWith(Path.PathSeparator.ToString()))
                s = s + Path.PathSeparator.ToString();
            return s;
        }


    }
}